package com.bw.mapper;

import com.bw.bean.Vo1;
import com.bw.bean.Vo2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoMapper {

    @Select("select bt.name name,ui.gender value,sum(oi.total_amount) number2 from order_info oi\n" +
            "left join user_info ui on ui.id = oi.user_id\n" +
            "left join base_trademark bt on bt.id = oi.tm_id\n" +
            "group by bt.name, ui.gender;")
    List<Vo1> getList1();

    @Select("select bt.name name,sum(oi.total_amount )value from order_info oi\n" +
            "left join user_info ui on ui.id = oi.user_id\n" +
            "left join base_trademark bt on bt.id = oi.tm_id\n" +
            "group by bt.name;")
    List<Vo2> getList2();

    @Select("select ui.birthday name,sum(oi.total_amount) value from order_info oi\n" +
            "left join user_info ui on ui.id = oi.user_id\n" +
            "group by ui.birthday;")
    List<Vo2> getList3();

    @Select("select bp.name name,sum(oi.total_amount) value from order_info oi\n" +
            "left join base_province bp on bp.id = oi.province_id\n" +
            "group by bp.name;")
    List<Vo2> getList4();
}
